﻿using System;
using System.ComponentModel;
using System.Runtime.InteropServices;

namespace Teigha.Core
{
	public class OdGiLayerTraitsData : IDisposable
	{
		[EditorBrowsable(EditorBrowsableState.Never)]
		public OdGiLayerTraitsData(IntPtr cPtr, bool cMemoryOwn)
		{
			this.swigCMemOwn = cMemoryOwn;
			this.swigCPtr = new HandleRef(this, cPtr);
		}

		[EditorBrowsable(EditorBrowsableState.Never)]
		public static HandleRef getCPtr(OdGiLayerTraitsData obj)
		{
			if (obj != null)
			{
				return obj.swigCPtr;
			}
			return new HandleRef(null, IntPtr.Zero);
		}

		~OdGiLayerTraitsData()
		{
			this.Dispose();
		}

		public virtual void Dispose()
		{
			if (this.swigCPtr.Handle != IntPtr.Zero)
			{
				if (this.swigCMemOwn)
				{
					lock (this.locker)
					{
						if (this.swigCPtr.Handle != IntPtr.Zero && this.swigCMemOwn)
						{
							this.swigCMemOwn = false;
							GlobalsPINVOKE.delete_OdGiLayerTraitsData(this.swigCPtr);
						}
					}
					this.swigCMemOwn = false;
				}
				this.swigCPtr = new HandleRef(null, IntPtr.Zero);
			}
			GC.SuppressFinalize(this);
		}

		public OdGiLayerTraitsData() : this(GlobalsPINVOKE.new_OdGiLayerTraitsData(), true)
		{
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public void Assign(OdGiLayerTraitsData other)
		{
			GlobalsPINVOKE.OdGiLayerTraitsData_Assign(this.swigCPtr, OdGiLayerTraitsData.getCPtr(other));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public uint flags()
		{
			uint result = GlobalsPINVOKE.OdGiLayerTraitsData_flags(this.swigCPtr);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public LineWeight lineweight()
		{
			LineWeight result = (LineWeight)GlobalsPINVOKE.OdGiLayerTraitsData_lineweight(this.swigCPtr);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OdDbStub linetype()
		{
			IntPtr intPtr = GlobalsPINVOKE.OdGiLayerTraitsData_linetype(this.swigCPtr);
			OdDbStub result = (intPtr == IntPtr.Zero) ? null : new OdDbStub(intPtr, false);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public PlotStyleNameType plotStyleNameType()
		{
			PlotStyleNameType result = (PlotStyleNameType)GlobalsPINVOKE.OdGiLayerTraitsData_plotStyleNameType(this.swigCPtr);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OdDbStub plotStyleNameId()
		{
			IntPtr intPtr = GlobalsPINVOKE.OdGiLayerTraitsData_plotStyleNameId(this.swigCPtr);
			OdDbStub result = (intPtr == IntPtr.Zero) ? null : new OdDbStub(intPtr, false);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OdCmEntityColor trueColor()
		{
			OdCmEntityColor result = new OdCmEntityColor(GlobalsPINVOKE.OdGiLayerTraitsData_trueColor(this.swigCPtr), false);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OdDbStub materialId()
		{
			IntPtr intPtr = GlobalsPINVOKE.OdGiLayerTraitsData_materialId(this.swigCPtr);
			OdDbStub result = (intPtr == IntPtr.Zero) ? null : new OdDbStub(intPtr, false);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OdCmTransparency transparency()
		{
			OdCmTransparency result = new OdCmTransparency(GlobalsPINVOKE.OdGiLayerTraitsData_transparency(this.swigCPtr), true);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public void setTrueColor(OdCmEntityColor cl)
		{
			GlobalsPINVOKE.OdGiLayerTraitsData_setTrueColor(this.swigCPtr, OdCmEntityColor.getCPtr(cl));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public void setLineweight(LineWeight lw)
		{
			GlobalsPINVOKE.OdGiLayerTraitsData_setLineweight(this.swigCPtr, (int)lw);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public void setLinetype(OdDbStub id)
		{
			GlobalsPINVOKE.OdGiLayerTraitsData_setLinetype(this.swigCPtr, OdDbStub.getCPtr(id));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public void setMaterial(OdDbStub id)
		{
			GlobalsPINVOKE.OdGiLayerTraitsData_setMaterial(this.swigCPtr, OdDbStub.getCPtr(id));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public void setTransparency(OdCmTransparency transparency)
		{
			GlobalsPINVOKE.OdGiLayerTraitsData_setTransparency(this.swigCPtr, OdCmTransparency.getCPtr(transparency));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public bool isOff()
		{
			bool result = GlobalsPINVOKE.OdGiLayerTraitsData_isOff(this.swigCPtr);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public void setOff(bool bVal)
		{
			GlobalsPINVOKE.OdGiLayerTraitsData_setOff(this.swigCPtr, bVal);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public bool isPlottable()
		{
			bool result = GlobalsPINVOKE.OdGiLayerTraitsData_isPlottable(this.swigCPtr);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public void setPlottable(bool bVal)
		{
			GlobalsPINVOKE.OdGiLayerTraitsData_setPlottable(this.swigCPtr, bVal);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public bool isFrozen()
		{
			bool result = GlobalsPINVOKE.OdGiLayerTraitsData_isFrozen(this.swigCPtr);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public bool isByBlock()
		{
			bool result = GlobalsPINVOKE.OdGiLayerTraitsData_isByBlock(this.swigCPtr);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public uint m_flags
		{
			get
			{
				uint result = GlobalsPINVOKE.OdGiLayerTraitsData_m_flags_get(this.swigCPtr);
				if (GlobalsPINVOKE.SWIGPendingException.Pending)
				{
					throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
				}
				return result;
			}
			set
			{
				GlobalsPINVOKE.OdGiLayerTraitsData_m_flags_set(this.swigCPtr, value);
				if (GlobalsPINVOKE.SWIGPendingException.Pending)
				{
					throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
				}
			}
		}

		public LineWeight m_lineweight
		{
			get
			{
				LineWeight result = (LineWeight)GlobalsPINVOKE.OdGiLayerTraitsData_m_lineweight_get(this.swigCPtr);
				if (GlobalsPINVOKE.SWIGPendingException.Pending)
				{
					throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
				}
				return result;
			}
			set
			{
				GlobalsPINVOKE.OdGiLayerTraitsData_m_lineweight_set(this.swigCPtr, (int)value);
				if (GlobalsPINVOKE.SWIGPendingException.Pending)
				{
					throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
				}
			}
		}

		public PlotStyleNameType m_plotStyleNameType
		{
			get
			{
				PlotStyleNameType result = (PlotStyleNameType)GlobalsPINVOKE.OdGiLayerTraitsData_m_plotStyleNameType_get(this.swigCPtr);
				if (GlobalsPINVOKE.SWIGPendingException.Pending)
				{
					throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
				}
				return result;
			}
			set
			{
				GlobalsPINVOKE.OdGiLayerTraitsData_m_plotStyleNameType_set(this.swigCPtr, (int)value);
				if (GlobalsPINVOKE.SWIGPendingException.Pending)
				{
					throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
				}
			}
		}

		public OdCmEntityColor m_color
		{
			get
			{
				IntPtr intPtr = GlobalsPINVOKE.OdGiLayerTraitsData_m_color_get(this.swigCPtr);
				OdCmEntityColor result = (intPtr == IntPtr.Zero) ? null : new OdCmEntityColor(intPtr, false);
				if (GlobalsPINVOKE.SWIGPendingException.Pending)
				{
					throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
				}
				return result;
			}
			set
			{
				GlobalsPINVOKE.OdGiLayerTraitsData_m_color_set(this.swigCPtr, OdCmEntityColor.getCPtr(value));
				if (GlobalsPINVOKE.SWIGPendingException.Pending)
				{
					throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
				}
			}
		}

		public OdDbStub m_linetypeId
		{
			get
			{
				IntPtr intPtr = GlobalsPINVOKE.OdGiLayerTraitsData_m_linetypeId_get(this.swigCPtr);
				OdDbStub result = (intPtr == IntPtr.Zero) ? null : new OdDbStub(intPtr, false);
				if (GlobalsPINVOKE.SWIGPendingException.Pending)
				{
					throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
				}
				return result;
			}
			set
			{
				GlobalsPINVOKE.OdGiLayerTraitsData_m_linetypeId_set(this.swigCPtr, OdDbStub.getCPtr(value));
				if (GlobalsPINVOKE.SWIGPendingException.Pending)
				{
					throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
				}
			}
		}

		public OdDbStub m_plotStyleNameId
		{
			get
			{
				IntPtr intPtr = GlobalsPINVOKE.OdGiLayerTraitsData_m_plotStyleNameId_get(this.swigCPtr);
				OdDbStub result = (intPtr == IntPtr.Zero) ? null : new OdDbStub(intPtr, false);
				if (GlobalsPINVOKE.SWIGPendingException.Pending)
				{
					throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
				}
				return result;
			}
			set
			{
				GlobalsPINVOKE.OdGiLayerTraitsData_m_plotStyleNameId_set(this.swigCPtr, OdDbStub.getCPtr(value));
				if (GlobalsPINVOKE.SWIGPendingException.Pending)
				{
					throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
				}
			}
		}

		public OdDbStub m_materialId
		{
			get
			{
				IntPtr intPtr = GlobalsPINVOKE.OdGiLayerTraitsData_m_materialId_get(this.swigCPtr);
				OdDbStub result = (intPtr == IntPtr.Zero) ? null : new OdDbStub(intPtr, false);
				if (GlobalsPINVOKE.SWIGPendingException.Pending)
				{
					throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
				}
				return result;
			}
			set
			{
				GlobalsPINVOKE.OdGiLayerTraitsData_m_materialId_set(this.swigCPtr, OdDbStub.getCPtr(value));
				if (GlobalsPINVOKE.SWIGPendingException.Pending)
				{
					throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
				}
			}
		}

		public OdCmTransparency m_cmTransparency
		{
			get
			{
				IntPtr intPtr = GlobalsPINVOKE.OdGiLayerTraitsData_m_cmTransparency_get(this.swigCPtr);
				OdCmTransparency result = (intPtr == IntPtr.Zero) ? null : new OdCmTransparency(intPtr, false);
				if (GlobalsPINVOKE.SWIGPendingException.Pending)
				{
					throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
				}
				return result;
			}
			set
			{
				GlobalsPINVOKE.OdGiLayerTraitsData_m_cmTransparency_set(this.swigCPtr, OdCmTransparency.getCPtr(value));
				if (GlobalsPINVOKE.SWIGPendingException.Pending)
				{
					throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
				}
			}
		}

		private object locker = new object();

		private HandleRef swigCPtr;

		protected bool swigCMemOwn;
	}
}
